package member.action;

import java.io.IOException;

import member.dao.MemberDAO;
import member.model.MemberInfo;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.Preparable;
import com.opensymphony.xwork2.ModelDriven;

public class ViewAction implements Action,Preparable,ModelDriven{
	
	private MemberInfo memberInfo;
	private MemberDAO memberDAO = MemberDAO.getInstance();;
	private String USERID;
	
	private String currentPage;
	
	public String execute() throws Exception {
		memberInfo = memberDAO.selectOne(USERID);
		return SUCCESS;
	}
	
	public String delete() throws Exception{
		memberDAO.delete(USERID);	
		return SUCCESS;
	}
	
	
	public MemberInfo getMemberInfo() {
		return memberInfo;
	}
	public void setMemberInfo(MemberInfo memberInfo) {
		this.memberInfo = memberInfo;
	}
	public String getUSERID() {
		return USERID;
	}
	public void setUSERID(String uSERID) {
		USERID = uSERID;
	}
	public String getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(String currentPage) {
		this.currentPage = currentPage;
	}
	public void prepare() throws Exception {
		memberInfo = new MemberInfo();
	}	
	public Object getModel() {
		return memberInfo;
	}
	
}
